package com.woniuxy.rbac.service.impl;

import com.woniuxy.rbac.entity.Role;
import com.woniuxy.rbac.mapper.RoleMapper;
import com.woniuxy.rbac.service.IRoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: linKe
 * @Date: 2021/11/22 23:47
 * @FileName: RoleServiceImpl
 * @version: 1.0
 * @Description: 描述
 */
@Service
public class RoleServiceImpl implements IRoleService {
    /**
     * 注入持久层实例
     */
    @Resource
    private RoleMapper roleMapper;

    @Override
   public List<Role> findAllById(int id){

        return roleMapper.searchAllById(id);
    }

    @Override
    public Role findById(int id) {
        return roleMapper.selectById(id);
    }

    @Override
    public List<Role> findAll() {
        return roleMapper.selectList(null);
    }
}
